<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuration : DataMapper ORM - User Guide</title>

<link rel="shortcut icon" type="image/png" href="../images/favicon.png" />
<link rel="stylesheet" type="text/css" media="all" href="../css/userguide.css" />
<link rel="alternate" type="application/rss+xml" title="Datamapper ORM Updates Feed" href="/rss.xml" />

<meta http-equiv="expires" content="-1" />
<meta http-equiv= 'pragma' content="no-cache" />
<meta name="robots" content="all" />

</head>

<body>

<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner"></div></div>
<div id="nav2"><a name="top">&nbsp;</a><a id="nav_toggle" href="#"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>DataMapper ORM</h1></td>
<td id="breadcrumb_right"><a href="toc.html">Table of Contents Page</a></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->

<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="/">Datamapper ORM Home</a> &nbsp;&#8250;&nbsp;
<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
Credits
</td>
</tr>

</table>
<!-- END BREADCRUMB -->

<br clear="all" />


<!-- START CONTENT -->
<div id="content">


<h1>Configuration</h1>

<p>DataMapper has some configuration settings which you can customise to suit your needs.  They will apply to all DataMapper models unless overridden in the models themselves.  These are:</p>

<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
<th>Since Ver.</th>
</tr>
<tr>
<td><strong>prefix</strong></td>
<td>String</td>
<td>If set, will require all tables (both normal and joining tables) to have this prefix.</td>
<td></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>join_prefix</strong></td>
<td>String</td>
<td>If set, will require all joining tables to have this prefix (overrides prefix).</td>
<td></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>error_prefix</strong></td>
<td>String</td>
<td>If set, will be prepended onto each error message.</td>
<td><dfn>&lt;p&gt;</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>error_suffix</strong></td>
<td>String</td>
<td>If set, will be appended onto each error message.</td>
<td><dfn>&lt;/p&gt;</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>created_field</strong></td>
<td>String</td>
<td>The field name for storing the created timestamp.</td>
<td><dfn>created</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>updated_field</strong></td>
<td>String</td>
<td>The field name for storing the updated timestamp.</td>
<td><dfn>updated</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>local_time</strong></td>
<td>Boolean</td>
<td>If set to TRUE, will use local timestamps. Otherwise, GMT/UTC is used.</td>
<td><dfn>FALSE</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>unix_timestamp</strong></td>
<td>Boolean</td>
<td>If set to TRUE, will use 'Unix Timestamp' instead of 'DateTime'.</td>
<td><dfn>FALSE</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>auto_transaction</strong></td>
<td>Boolean</td>
<td>If set to TRUE, will automatically handle <a href="troubleshooting.html#Database.Transactions">transactions</a>.</td>
<td><dfn>FALSE</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>auto_populate_has_many</strong></td>
<td>Boolean</td>
<td>If set to TRUE, will automatically populate related "has many" objects on first access.</td>
<td><dfn>FALSE</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>auto_populate_has_one</strong></td>
<td>Boolean</td>
<td>If set to TRUE, will automatically populate related "has one" objects on first access.</td>
<td><dfn>FALSE</dfn></td>
<td><i>DataMapper</i></td>
</tr>
<tr>
<td><strong>production_cache</strong></td>
<td>Mixed</td>
<td>If set to a string, will cause DataMapper to <a href="prodcache.html">cache the database schema</a> to the directory listed.</td>
<td><dfn>FALSE</dfn></td>
<td>1.3.0</td>
</tr>
<tr>
<td><strong>extensions</strong></td>
<td>Array</td>
<td>An array of <a href="extensions.html#Extensions">extensions</a> to load globally on every class.</td>
<td><i>(empty)</i></td>
<td>1.3.0</td>
</tr>
<tr>
<td><strong>extensions_path</strong></td>
<td>String</td>
<td>The default path to extensions, relative to <b>application</b></td>
<td><dfn>datamapper</dfn></td>
<td>1.3.0</td>
</tr>
<tr>
<td><strong>all_array_uses_ids</strong></td>
<td>Boolean</td>
<td>If <dfn>TRUE</dfn>, uses the old DataMapper behavior for indexing the <var><i>all</i></var> array.</td>
<td><dfn>FALSE</dfn></td>
<td>1.5.2</td>
</tr>
<tr>
<td><strong>db_params</strong></td>
<td>Mixed</td>
<td>If <dfn>''</dfn> (empty string), Datamapper ORM models will connect using the default DataBase config.<br/>
	If <dfn>FALSE</dfn>, all models will connect to <var>$CI</var><kbd>-&gt;</kbd><var>db</var>.  (Note: this breaks <a href="subqueries.html">subqueries</a>, and any feature that relies on subqueries.)<br/>
	If anything else, the value is passed into <var>$CI</var><kbd>-&gt;</kbd><var>load</var><kbd>-&gt;</kbd><var>database()</var>.  See the <a href="http://codeigniter.com/user_guide/database/connecting.html">CodeIgniter manual</a> for more information.</td>
<td><dfn>''</dfn></td>
<td>1.6.0</td>
</tr>
<tr>
<td><strong>timestamp_format</strong></td>
<td>String</td>
<td>Overrides the default <a href="http://us.php.net/manual/en/function.date.php"><var><b>date</b></var>-compatible</a> timestamp format.</td>
<td><dfn>Y-m-d H:i:s O</dfn></td>
<td>1.7.0</td>
</tr>
<tr>
<td><strong>lang_file_format</strong></td>
<td>String</td>
<td>When set, this pattern is used to tell Datamapper ORM which <a href="localize.html">language file</a> to load for each model.<br/>
	For new installations, this actually defaults to <dfn>'model_${model}'</dfn>.</td>
<td><dfn>''</dfn></td>
<td>1.7.0</td>
</tr>
<tr>
<td><strong>field_label_lang_format</strong></td>
<td>String</td>
<td>Tells Datamapper ORM which <a href="localize.html">language pattern</a> to use when loading labels for fields.</td>
<td><dfn>${model}_${field}</dfn></td>
<td>1.7.0</td>
</tr>
<tr>
<td><strong>cascade_delete</strong></td>
<td>Boolean</td>
<td>If set to FALSE, relations will NOT be deleted by datamapper when deleting an object. Your RDBMS should take care of <a href="troubleshooting.html#Relationships.CascadingDeletes">cascading deletes</a>.</td>
<td><dfn>TRUE</dfn></td>
<td>1.8.1</td>
</tr>
</table>

<p>To modify your settings, open the <var>application/config/datamapper.php</var> file with a text editor and set your preferred configuration settings.</p>

<p class="note"><strong>Note:</strong>&nbsp; You can override these settings by specifying values directly in your models, except for <strong>production_cache</strong> and <strong>extensions_path</strong>.</p>


</div>
<!-- END CONTENT -->


<div id="footer">
<p>
<span id="footer_previous">Previous Topic:&nbsp;&nbsp;<a href=""></a>
&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;</span>
<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="../index.html">User Guide Home</a>
<span id="footer_next">&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
Next Topic:&nbsp;&nbsp;<a href=""></a></span>
</p>
<div id="copyrights">
<p><a href="/">Datamapper ORM</a> &nbsp;&middot;&nbsp; Copyright &copy; 2010-2011 &nbsp;&middot;&nbsp; Harro "WanWizard" Verton</p>
<p><a href="license.html">Other License Information</a></p>
</div>
</div>

<script type="text/javascript" src="../js/mootools.js"></script>
<script type="text/javascript" src="../js/menu.js"></script>
<script type="text/javascript">
<!--
	window.addEvent('domready', function() {

		// Create Menu
		var menu = new Menu({
			basepath: '../',
			pagespath: ''
		});

	});
//-->
</script>
</body>
</html>
